/**
 * <copyright>
 * </copyright>
 *

 */
package ms.unicorn.language.languagedef.impl;

import ms.unicorn.language.languagedef.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class LanguagedefFactoryImpl extends EFactoryImpl implements LanguagedefFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static LanguagedefFactory init()
  {
    try
    {
      LanguagedefFactory theLanguagedefFactory = (LanguagedefFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.unicorn.ms/language/definition"); 
      if (theLanguagedefFactory != null)
      {
        return theLanguagedefFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new LanguagedefFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LanguagedefFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case LanguagedefPackage.MODULE: return createModule();
      case LanguagedefPackage.LIBRARY: return createLibrary();
      case LanguagedefPackage.MODULE_ITEM: return createModuleItem();
      case LanguagedefPackage.NAMESPACE: return createNamespace();
      case LanguagedefPackage.LANGUAGE_DEF: return createLanguageDef();
      case LanguagedefPackage.PARENT_LANGUAGES: return createParentLanguages();
      case LanguagedefPackage.IMPORT_STATEMENT: return createImportStatement();
      case LanguagedefPackage.TOOL_BOX: return createToolBox();
      case LanguagedefPackage.TOOL_ITEM: return createToolItem();
      case LanguagedefPackage.TOOL_VIEW: return createToolView();
      case LanguagedefPackage.TAG_DEF: return createTagDef();
      case LanguagedefPackage.TAG_ENTRY_DEF: return createTagEntryDef();
      case LanguagedefPackage.ELEMENT_DEF: return createElementDef();
      case LanguagedefPackage.ENTITY_DEF: return createEntityDef();
      case LanguagedefPackage.RELATION_DEF: return createRelationDef();
      case LanguagedefPackage.POLICIES: return createPolicies();
      case LanguagedefPackage.VIEW_DEF: return createViewDef();
      case LanguagedefPackage.NODE_VIEW_DEF: return createNodeViewDef();
      case LanguagedefPackage.LABEL_VIEW_DEF: return createLabelViewDef();
      case LanguagedefPackage.LABEL_SOURCE_FIELD: return createLabelSourceField();
      case LanguagedefPackage.COMPARTMENT_VIEW_DEF: return createCompartmentViewDef();
      case LanguagedefPackage.RELATION_VIEW_DEF: return createRelationViewDef();
      case LanguagedefPackage.RELATION_CONSTRAINT: return createRelationConstraint();
      case LanguagedefPackage.CONNECTION_STYLE_DEF: return createConnectionStyleDef();
      case LanguagedefPackage.CONNECTION_DECORATOR: return createConnectionDecorator();
      case LanguagedefPackage.DECORATOR_DEF: return createDecoratorDef();
      case LanguagedefPackage.DECORATOR_LOCATOR_DEF: return createDecoratorLocatorDef();
      case LanguagedefPackage.POLICY_DEF: return createPolicyDef();
      case LanguagedefPackage.SUB_VIEW_DEF: return createSubViewDef();
      case LanguagedefPackage.FIGURE_DEF: return createFigureDef();
      case LanguagedefPackage.SUB_FIGURE: return createSubFigure();
      case LanguagedefPackage.PARAMETER: return createParameter();
      case LanguagedefPackage.COLOR_DEF: return createColorDef();
      case LanguagedefPackage.VALIDATOR_DEF: return createValidatorDef();
      case LanguagedefPackage.ANCHOR: return createAnchor();
      case LanguagedefPackage.XRECTANGLE: return createXRectangle();
      case LanguagedefPackage.XREFERENCE_EXPRESSION: return createXReferenceExpression();
      case LanguagedefPackage.TOOL_GROUP: return createToolGroup();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case LanguagedefPackage.PARAMETER_TYPE:
        return createParameterTypeFromString(eDataType, initialValue);
      case LanguagedefPackage.LINE_STYLE:
        return createLineStyleFromString(eDataType, initialValue);
      case LanguagedefPackage.DOCK_TYPE:
        return createDockTypeFromString(eDataType, initialValue);
      case LanguagedefPackage.DECORATOR_LOCATION:
        return createDecoratorLocationFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case LanguagedefPackage.PARAMETER_TYPE:
        return convertParameterTypeToString(eDataType, instanceValue);
      case LanguagedefPackage.LINE_STYLE:
        return convertLineStyleToString(eDataType, instanceValue);
      case LanguagedefPackage.DOCK_TYPE:
        return convertDockTypeToString(eDataType, instanceValue);
      case LanguagedefPackage.DECORATOR_LOCATION:
        return convertDecoratorLocationToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Module createModule()
  {
    ModuleImpl module = new ModuleImpl();
    return module;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Library createLibrary()
  {
    LibraryImpl library = new LibraryImpl();
    return library;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ModuleItem createModuleItem()
  {
    ModuleItemImpl moduleItem = new ModuleItemImpl();
    return moduleItem;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Namespace createNamespace()
  {
    NamespaceImpl namespace = new NamespaceImpl();
    return namespace;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LanguageDef createLanguageDef()
  {
    LanguageDefImpl languageDef = new LanguageDefImpl();
    return languageDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ParentLanguages createParentLanguages()
  {
    ParentLanguagesImpl parentLanguages = new ParentLanguagesImpl();
    return parentLanguages;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ImportStatement createImportStatement()
  {
    ImportStatementImpl importStatement = new ImportStatementImpl();
    return importStatement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ToolBox createToolBox()
  {
    ToolBoxImpl toolBox = new ToolBoxImpl();
    return toolBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ToolItem createToolItem()
  {
    ToolItemImpl toolItem = new ToolItemImpl();
    return toolItem;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ToolView createToolView()
  {
    ToolViewImpl toolView = new ToolViewImpl();
    return toolView;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TagDef createTagDef()
  {
    TagDefImpl tagDef = new TagDefImpl();
    return tagDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TagEntryDef createTagEntryDef()
  {
    TagEntryDefImpl tagEntryDef = new TagEntryDefImpl();
    return tagEntryDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ElementDef createElementDef()
  {
    ElementDefImpl elementDef = new ElementDefImpl();
    return elementDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EntityDef createEntityDef()
  {
    EntityDefImpl entityDef = new EntityDefImpl();
    return entityDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RelationDef createRelationDef()
  {
    RelationDefImpl relationDef = new RelationDefImpl();
    return relationDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Policies createPolicies()
  {
    PoliciesImpl policies = new PoliciesImpl();
    return policies;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ViewDef createViewDef()
  {
    ViewDefImpl viewDef = new ViewDefImpl();
    return viewDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NodeViewDef createNodeViewDef()
  {
    NodeViewDefImpl nodeViewDef = new NodeViewDefImpl();
    return nodeViewDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LabelViewDef createLabelViewDef()
  {
    LabelViewDefImpl labelViewDef = new LabelViewDefImpl();
    return labelViewDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LabelSourceField createLabelSourceField()
  {
    LabelSourceFieldImpl labelSourceField = new LabelSourceFieldImpl();
    return labelSourceField;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CompartmentViewDef createCompartmentViewDef()
  {
    CompartmentViewDefImpl compartmentViewDef = new CompartmentViewDefImpl();
    return compartmentViewDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RelationViewDef createRelationViewDef()
  {
    RelationViewDefImpl relationViewDef = new RelationViewDefImpl();
    return relationViewDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RelationConstraint createRelationConstraint()
  {
    RelationConstraintImpl relationConstraint = new RelationConstraintImpl();
    return relationConstraint;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ConnectionStyleDef createConnectionStyleDef()
  {
    ConnectionStyleDefImpl connectionStyleDef = new ConnectionStyleDefImpl();
    return connectionStyleDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ConnectionDecorator createConnectionDecorator()
  {
    ConnectionDecoratorImpl connectionDecorator = new ConnectionDecoratorImpl();
    return connectionDecorator;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DecoratorDef createDecoratorDef()
  {
    DecoratorDefImpl decoratorDef = new DecoratorDefImpl();
    return decoratorDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DecoratorLocatorDef createDecoratorLocatorDef()
  {
    DecoratorLocatorDefImpl decoratorLocatorDef = new DecoratorLocatorDefImpl();
    return decoratorLocatorDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PolicyDef createPolicyDef()
  {
    PolicyDefImpl policyDef = new PolicyDefImpl();
    return policyDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SubViewDef createSubViewDef()
  {
    SubViewDefImpl subViewDef = new SubViewDefImpl();
    return subViewDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public FigureDef createFigureDef()
  {
    FigureDefImpl figureDef = new FigureDefImpl();
    return figureDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SubFigure createSubFigure()
  {
    SubFigureImpl subFigure = new SubFigureImpl();
    return subFigure;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Parameter createParameter()
  {
    ParameterImpl parameter = new ParameterImpl();
    return parameter;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ColorDef createColorDef()
  {
    ColorDefImpl colorDef = new ColorDefImpl();
    return colorDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ValidatorDef createValidatorDef()
  {
    ValidatorDefImpl validatorDef = new ValidatorDefImpl();
    return validatorDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Anchor createAnchor()
  {
    AnchorImpl anchor = new AnchorImpl();
    return anchor;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public XRectangle createXRectangle()
  {
    XRectangleImpl xRectangle = new XRectangleImpl();
    return xRectangle;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public XReferenceExpression createXReferenceExpression()
  {
    XReferenceExpressionImpl xReferenceExpression = new XReferenceExpressionImpl();
    return xReferenceExpression;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ToolGroup createToolGroup()
  {
    ToolGroupImpl toolGroup = new ToolGroupImpl();
    return toolGroup;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ParameterType createParameterTypeFromString(EDataType eDataType, String initialValue)
  {
    ParameterType result = ParameterType.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertParameterTypeToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LineStyle createLineStyleFromString(EDataType eDataType, String initialValue)
  {
    LineStyle result = LineStyle.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertLineStyleToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DockType createDockTypeFromString(EDataType eDataType, String initialValue)
  {
    DockType result = DockType.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertDockTypeToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DecoratorLocation createDecoratorLocationFromString(EDataType eDataType, String initialValue)
  {
    DecoratorLocation result = DecoratorLocation.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertDecoratorLocationToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LanguagedefPackage getLanguagedefPackage()
  {
    return (LanguagedefPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static LanguagedefPackage getPackage()
  {
    return LanguagedefPackage.eINSTANCE;
  }

} //LanguagedefFactoryImpl
